<?php

class ReportsController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        $auth = Zend_Auth::getInstance();
       	if ($auth->hasIdentity()) 
        {
            $user_id = $auth->getIdentity()->id; 
        }
        else 
        {
        	$this->_redirect('authentication/login');
        }
        
        $this->getAttacksYouMade($user_id);
        $this->getAttacksAgainstYou($user_id);
    }
    
 	private function getAttacksYouMade($user_id)
    {
    	$reports = new Application_Model_ReportsTbl();
    	$offensiveReports = $reports->getOffensiveReports($user_id);
    	$this->view->offensiveReports = $offensiveReports;
    }
    
	private function getAttacksAgainstYou($user_id)
    {
    	$reports = new Application_Model_ReportsTbl();
    	$defensiveReports = $reports->getDefensiveReports($user_id);
    	$this->view->defensiveReports = $defensiveReports;
    }	


}

